<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var   num=new Date().getDay();
        switch(num){
            case  1:
             y="星期一";
            break;
            case  2:
            y="星期2";
            break;
            case  3: y="星期3";
            break;
            case  4: y="星期4";
            break;
            case  5: y="星期5";
            break;
            case  6: y="星期6";
            break;
            case  0: y="星期日";
            break

        }
        alert("今天是"+y);




    </script>
    
</body>
</html>